//
//  AECheckbox.cpp
//  GameJam-Mac
//
//  Created by Clover Sin on 12/30/11.
//  Copyright (c) 2011 Snow Poem Society. All rights reserved.
//

#include "stdafx.h"

#include "AECheckbox.h"
#include "AELabel.h"

AECheckbox::AECheckbox(AEControl* parent, AETheme* theme):
    AEControl(parent, theme), 
    _checkState(false), 
    _iconBox(NULL), 
    _label(NULL)
{
    // TODO: Initialize icon box and label. 
    //       Text position relates to Font size and 
    //         text length.
    
    // Resize bounding box to the icon box. 
    
}

void AECheckbox::prepareForAddingToWorld()
{
    syncChildrenPosition();
    
    _label->prepareForAddingToWorld();
    theWorld.Add(_label);
    // TODO: Add the icon box to the world.
    
}

bool AECheckbox::MouseClick(MouseButtonInput button)
{
    // Check or uncheck. 
    if (this->isEnable())
        _checkState = !_checkState;
    
    return true;
}

